package com.pw.study.web.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: linux_future
 * @since: 2022/3/15
 **/
@RestController
public class HelloController {

    @GetMapping("/hello")
    public String index() {

        System.out.println("========================***************************");
        return "ok";
    }

    @GetMapping("/json")
    public Object json() {
        System.out.println("hello.. json.......");

        String str = "{\"cart_ct\":0,\"category3_id\":477,\"category3_name\":\"唇部\",\"click_ct\":0,\"comment_ct\":2,\"display_ct\":0,\"edt\":\"2021-03-26 02:32:25\",\"favor_ct\":0,\"good_comment_ct\":0,\"orderIdSet\":[],\"order_amount\":0,\"order_ct\":0,\"order_sku_num\":0,\"paidOrderIdSet\":[],\"paid_order_ct\":0,\"payment_amount\":0,\"refundOrderIdSet\":[],\"refund_amount\":0,\"refund_order_ct\":0,\"sku_id\":27,\"sku_name\":\"索芙特i-Softto 口红不掉色唇膏保湿滋润 璀璨金钻哑光唇膏 Z02少女红 活力青春 璀璨金钻哑光唇膏 \",\"sku_price\":129,\"spu_id\":9,\"spu_name\":\"索芙特i-Softto 口红不掉色唇膏保湿滋润 璀璨金钻哑光唇膏 \",\"stt\":\"2021-03-26 02:32:20\",\"tm_id\":8,\"tm_name\":\"索芙特\",\"ts\":1648477679507}";
        JSONObject jsonObject = JSON.parseObject(str);
        return jsonObject;
    }
}
